// 商品接口层
import request from '@/utile/request'

// 获取商品列表
export function getGoodsList(params) {
    return request.get('/goods/list', {params})
}

//删除商品
export function deleteGoods(params) {
    return request.get('/goods/del', {params})
}

//获得所有分类信息
export function getGoodsType() {
    return request.get('/goods/categories')
}

//修改商品
export function updateGoods(data) {
    return request.post('/goods/edit', data);
}

//添加商品
export function addGoods(data) {
    return request.post('/goods/add', data);
}

//获取分类表格
export function getGoodsTypeList(params) {
    return request.get('/goods/catelist', {params})
}


//修改分类
export function updateGoodsType(data) {
    return request.post('/goods/editcate', data);
}

//删除分类
export function deleteGoodsType(params) {
    return request.get('/goods/delcate', {params})
}
//添加分类
export function addGoodsType(data) {
    return request.post('/goods/addcate', data);
}